#include"stdio.h"
long long n,c,a[100005];
void quicksort(int left,int right)
{
   int i,j,t,temp;
   if(left>=right)
   {
       return;
   }
   temp=a[left];
   i=left;
   j=right;
   while(i<j)
   {
       while(a[j]>=temp&&i<j)
       j--;
       while(a[i]<=temp&&i<j)
        i++;
       if(i<j)
       {
           t=a[i];
           a[i]=a[j];
           a[j]=t;
        }
   }
   a[left]=a[i];
   a[i]=temp;
   quicksort(left,i-1);
   quicksort(i+1,right);

}

int judge(int m)
{
    int i,end=1,num=1;
    for(i=2;i<=n;i++)
    {
        if(a[i]-a[end]>=m)
        {    num++;
            end=i;

        }
    }
   return num;
}
int yes(int left,int right)
{
    int i,q;
   while(left<=right)
   {  int mid=(left+right)/2;
        if(judge(mid)>=c)
        {    q=mid;
            left=mid+1;
        }
        else right=mid-1;
   }
   return q;
}
int main()
{
    int i,y;
    scanf("%lld%lld",&n,&c);
    for(i=1;i<=n;i++)
        scanf("%lld",&a[i]);
    quicksort(1,n);
    y=a[n];
      y=yes(1,(a[n]+10)/2);
      printf("%d",y);
}
